/**
 * strex.h
 * @author Martin Zhang
 * @date 2021-08-03
 * @note string extensions
 */

#ifndef FTPSERVER2_0_STREX_H
#define FTPSERVER2_0_STREX_H

#include <string.h>
#include <ctype.h>

void str_toupper(char *s);
void str_tolower(char *s);
void str_split(char *s, char *left, char *right, const char *delim);
void str_trim(const char *s, char *new_s, size_t n);
void str_trim_self(char *s);
int  str_contains_ifnot(char *s, typeof(isspace) func);
int  str_contains_if(char *s, typeof(isspace) func);
int str_start_with(const char *s, char c);
int str_end_with(const char *s, char c);
int str_replace_char(char *s, char old_c, char new_c);

#endif //FTPSERVER2_0_STREX_H
